package com.ruoyi.web.controller.application;

import com.ruoyi.application.domain.Application;
import com.ruoyi.application.service.IApplicationService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/application")
public class ApplicationController extends BaseController {

    @Autowired
    private IApplicationService applicationService;

    /**
     * 查询申请列表
     */
    @PreAuthorize("@ss.hasPermi('application:application:list')")
    @GetMapping("/list")
    public TableDataInfo list(Application application) {
        startPage();
        List<Application> list = applicationService.selectApplicationList(application);
        return getDataTable(list);
    }
}
